Added documentation and C bindings for VM.migrate call.
authorewan@localhost.localdomain <ewan@localhost.localdomain>
Mon, 16 Apr 2007 20:12:33 +0000 (16:12 -0400)
committerewan@localhost.localdomain <ewan@localhost.localdomain>
Mon, 16 Apr 2007 20:12:33 +0000 (16:12 -0400)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
docs/xen-api/xenapi-datamodel.tex
tools/libxen/include/xen_vm.h
tools/libxen/src/xen_vm.c

index 39055b8d89ebb861788033e4d4c68f358f726c3f..78cc917a6e37cca15e036ec861cbaa3ae050d08e 100644 (file)
@@ -1733,6 +1733,47 @@ void
 
 
 
+\vspace{0.3cm}
+
+\noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
+
+\vspace{0.6cm}
+\subsubsection{RPC name:~migrate}
+
+{\bf Overview:} 
+Migrate the VM to another host.  This can only be called when the specified
+VM is in the Running state.
+
+ \noindent {\bf Signature:} 
+\begin{verbatim} void migrate (session_id s, VM ref vm, string dest, bool live, (string -> string) Map options)\end{verbatim}
+
+
+\noindent{\bf Arguments:}
+
+\vspace{0.3cm}
+\begin{tabular}{|c|c|p{7cm}|}
+ \hline
+{\bf type} & {\bf name} & {\bf description} \\ \hline
+{\tt VM ref } & vm & The VM \\ \hline 
+
+{\tt string } & dest & The destination host \\ \hline 
+
+{\tt bool } & live & Live migration \\ \hline 
+
+{\tt (string $\rightarrow$ string) Map } & options & Other parameters \\ \hline 
+
+\end{tabular}
+
+\vspace{0.3cm}
+
+ \noindent {\bf Return Type:} 
+{\tt 
+void
+}
+
+
+
 \vspace{0.3cm}
 
 \noindent{\bf Possible Error Codes:} {\tt VM\_BAD\_POWER\_STATE}
index 54abe1ba828a34ee480c2b537e8c51c41e82fd25..d33f31b860cffdb6a6516d73cb19af7aa70b485a 100644 (file)
@@ -876,6 +876,14 @@ extern bool
 xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
 
 
+/**
+ * Migrate the VM to another host.  This can only be called when the
+ * specified VM is in the Running state.
+ */
+extern bool
+xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
+
+
 /**
  * Return a list of all the VMs known to the system.
  */
index 6f88a9239a0325d7a4d89343e8979f398d1207cf..d2a4309a0da1a9db89e1e64e10e62871b24e460c 100644 (file)
@@ -1691,6 +1691,26 @@ xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger)
 }
 
 
+bool
+xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options)
+{
+    abstract_value param_values[] =
+        {
+            { .type = &abstract_type_string,
+              .u.string_val = vm },
+            { .type = &abstract_type_string,
+              .u.string_val = dest },
+            { .type = &abstract_type_bool,
+              .u.bool_val = live },
+            { .type = &abstract_type_string_string_map,
+              .u.set_val = (arbitrary_set *)options }
+        };
+
+    xen_call_(session, "VM.migrate", param_values, 4, NULL, NULL);
+    return session->ok;
+}
+
+
 bool
 xen_vm_get_all(xen_session *session, struct xen_vm_set **result)
 {